import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
import Mint from 'mint-ui'
import 'mint-ui/lib/style.css'

import Register from '@/pages/user/Register.vue'
import Login from '@/pages/user/Login.vue'
import Index from '@/pages/index/Index.vue'
import IndexDakaMessage from '@/pages/index/IndexDakaMessage.vue'
import QueryHeal from '@/pages/index/QueryHeal.vue'
import QueryNight from '@/pages/index/QueryNight.vue'
import GotoHeal from '@/pages/index/GotoHeal.vue'
import GotoNight from '@/pages/index/GotoNight.vue'
import User from '@/pages/user/User.vue'
import UserInfo from '@/pages/user/UserInfo.vue'
import UserEditHeal from '@/pages/user/UserEditHeal.vue'
import UserEditNight from '@/pages/user/UserEditNight.vue'

Vue.use(Mint)
Vue.use(VueRouter)
Vue.config.productionTip = false

const router = new VueRouter({
    routes: [
        {name: '', path: '/', redirect: '/index' },
        {name: '', path: '/register', components: {Main:Register}},
        {name: '', path: '/login', components: {Main:Login}},
        {name: '', path: '/index', components: {Main:Index}},
        {name: '', path: '/index_daka_message', components: {Main:IndexDakaMessage}},
        {name: '', path: '/query_heal', components: {Main:QueryHeal}},
        {name: '', path: '/query_night', components: {Main:QueryNight}},
        {name: '', path: '/goto_heal', components: {Main:GotoHeal}},
        {name: '', path: '/goto_night', components: {Main:GotoNight}},
        {name: '', path: '/user', components: {Main:User}},
        {name: '', path: '/user_info', components: {Main:UserInfo}},
        {name: '', path: '/user_edit_heal', components: {Main:UserEditHeal}},
        {name: '', path: '/user_edit_night', components: {Main:UserEditNight}}
    ]
})
new Vue({
    render: h => h(App),
    router: router,
    //组件通信
    beforeCreate() {
        Vue.prototype.$bus = this
        Vue.prototype.url = 'https://codebai.cn:13324'
    }
}).$mount('#app')
